//
//  SRLoading.h
//  YWQF_APP
//
//  Created by 孙锐 on 2018/4/18.
//  Copyright © 2018年 孙锐. All rights reserved.
//

#import <UIKit/UIKit.h>
typedef void(^reloadBlock)(void);

typedef NS_ENUM(NSInteger, SRLoadingStyleEnum) {
    SRLoadingStyleDefault = 1,//默认从0开始
    SRLoadingStyleClearBack
};


@interface SRLoading : UIView

/**
 //1.声明一个loading对象
 SRLoading *loading;
 //2.初始化loading 使用style1，白色背景
 __weak typeof(self) weakSelf = self;
 SRLoading *loading =  self->loading = [[SRLoading alloc]initWithFrame:CGRectMake(0, kStatusBarHeight+44, kScreenWidth, kScreenHeight-kStatusBarHeight-44) andStyle:SRLoadingStyleDefault andReloadBlock:^{
 [weakSelf loadData];
 }];
 //3.开始加载，将其显示在界面上
 [self.view addSubview:self->loading];
 //4.加载成功后，执行移除操作
 [self->loading removeFromSuperview];
 //5.加载失败后，显示失败样式
 [self->loading stopAnimateding];
 */


@property (copy, nonatomic) reloadBlock reload;
-(void)stopAnimateding;
-(void)animatedAgain;
- (instancetype)initWithFrame:(CGRect)frame andStyle:(SRLoadingStyleEnum)style andReloadBlock:(void(^)(void))block;
-(void)turnToEmptyWithContent:(NSString *)content;
@end
